package com.cm309.hospital.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cm309.hospital.dao.BookingStep2Dao;

@WebServlet("/bookingStep2.do")
public class bookingStep2 extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
//		super.doGet(req, resp);
	
		String subject_id = req.getParameter("subject_id");
		Short sub_id=Short.valueOf(subject_id);
		List doctors = new ArrayList();
		BookingStep2Dao doctorDao = new BookingStep2Dao();
		System.out.println(sub_id);
		doctors = doctorDao.queryById(sub_id);
		req.setAttribute("doctors",doctors);
		req.getRequestDispatcher("view/bookingStep2.jsp").forward(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
//		super.doPost(req, resp);
	}


}
